home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / QuickTime / QuickTime 3 Interfaces & Libs / QTDevWin / CIncludes / Processes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  6.2 KB  |  227 lines  |  [TEXT/dosa]

  1. /*
  2.      File:        Processes.h
  3.  
  4.      Contains:    Process Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1989-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __PROCESSES__
  19. #define __PROCESSES__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __EVENTS__
  25. #include <Events.h>
  26. #endif
  27. #ifndef __FILES__
  28. #include <Files.h>
  29. #endif
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=mac68k
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. /* type for unique process identifier */
  54.  
  55. struct ProcessSerialNumber {
  56.     unsigned long                     highLongOfPSN;
  57.     unsigned long                     lowLongOfPSN;
  58. };
  59. typedef struct ProcessSerialNumber        ProcessSerialNumber;
  60. typedef ProcessSerialNumber *            ProcessSerialNumberPtr;
  61.  
  62. enum {
  63.                                                                 /* Process identifier - Various reserved process serial numbers */
  64.     kNoProcess                    = 0,
  65.     kSystemProcess                = 1,
  66.     kCurrentProcess                = 2
  67. };
  68.  
  69. /* Definition of the parameter block passed to _Launch */
  70. /* Typedef and flags for launchControlFlags field*/
  71.  
  72. typedef unsigned short                     LaunchFlags;
  73.  
  74. enum {
  75.     launchContinue                = 0x4000,
  76.     launchNoFileFlags            = 0x0800,
  77.     launchUseMinimum            = 0x0400,
  78.     launchDontSwitch            = 0x0200,
  79.     launchAllow24Bit            = 0x0100,
  80.     launchInhibitDaemon            = 0x0080
  81. };
  82.  
  83. /* Format for first AppleEvent to pass to new process.  The size of the overall
  84.   buffer variable: the message body immediately follows the messageLength */
  85.  
  86. struct AppParameters {
  87.     EventRecord                     theMsgEvent;
  88.     unsigned long                     eventRefCon;
  89.     unsigned long                     messageLength;
  90. };
  91. typedef struct AppParameters            AppParameters;
  92. typedef AppParameters *                    AppParametersPtr;
  93. /* Parameter block to _Launch */
  94.  
  95. struct LaunchParamBlockRec {
  96.     unsigned long                     reserved1;
  97.     unsigned short                     reserved2;
  98.     unsigned short                     launchBlockID;
  99.     unsigned long                     launchEPBLength;
  100.     unsigned short                     launchFileFlags;
  101.     LaunchFlags                     launchControlFlags;
  102.     FSSpecPtr                         launchAppSpec;
  103.     ProcessSerialNumber             launchProcessSN;
  104.     unsigned long                     launchPreferredSize;
  105.     unsigned long                     launchMinimumSize;
  106.     unsigned long                     launchAvailableSize;
  107.     AppParametersPtr                 launchAppParameters;
  108. };
  109. typedef struct LaunchParamBlockRec        LaunchParamBlockRec;
  110.  
  111. typedef LaunchParamBlockRec *            LaunchPBPtr;
  112. /* Set launchBlockID to extendedBlock to specify that extensions exist.
  113.  Set launchEPBLength to extendedBlockLen for compatibility.*/
  114.  
  115. enum {
  116.     extendedBlock                = 0x4C43,                        /* 'LC' */
  117.     extendedBlockLen            = sizeof(LaunchParamBlockRec) - 12
  118. };
  119.  
  120.  
  121. enum {
  122.                                                                 /* Definition of the information block returned by GetProcessInformation */
  123.     modeLaunchDontSwitch        = 0x00040000,
  124.     modeDeskAccessory            = 0x00020000,
  125.     modeMultiLaunch                = 0x00010000,
  126.     modeNeedSuspendResume        = 0x00004000,
  127.     modeCanBackground            = 0x00001000,
  128.     modeDoesActivateOnFGSwitch    = 0x00000800,
  129.     modeOnlyBackground            = 0x00000400,
  130.     modeGetFrontClicks            = 0x00000200,
  131.     modeGetAppDiedMsg            = 0x00000100,
  132.     mode32BitCompatible            = 0x00000080,
  133.     modeHighLevelEventAware        = 0x00000040,
  134.     modeLocalAndRemoteHLEvents    = 0x00000020,
  135.     modeStationeryAware            = 0x00000010,
  136.     modeUseTextEditServices        = 0x00000008,
  137.     modeDisplayManagerAware        = 0x00000004
  138. };
  139.  
  140. /* Record returned by GetProcessInformation */
  141.  
  142. struct ProcessInfoRec {
  143.     unsigned long                     processInfoLength;
  144.     StringPtr                         processName;
  145.     ProcessSerialNumber             processNumber;
  146.     unsigned long                     processType;
  147.     OSType                             processSignature;
  148.     unsigned long                     processMode;
  149.     Ptr                             processLocation;
  150.     unsigned long                     processSize;
  151.     unsigned long                     processFreeMem;
  152.     ProcessSerialNumber             processLauncher;
  153.     unsigned long                     processLaunchDate;
  154.     unsigned long                     processActiveTime;
  155.     FSSpecPtr                         processAppSpec;
  156. };
  157. typedef struct ProcessInfoRec            ProcessInfoRec;
  158. typedef ProcessInfoRec *                ProcessInfoRecPtr;
  159.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  160.                                                                                             #pragma parameter __D0 LaunchApplication(__A0)
  161.                                                                                             #endif
  162. EXTERN_API( OSErr )
  163. LaunchApplication                (LaunchPBPtr             LaunchParams)                        ONEWORDINLINE(0xA9F2);
  164.  
  165. EXTERN_API( OSErr )
  166. LaunchDeskAccessory                (const FSSpec *            pFileSpec,
  167.                                  ConstStr255Param         pDAName)                            THREEWORDINLINE(0x3F3C, 0x0036, 0xA88F);
  168.  
  169. #if TARGET_OS_MAC
  170.     #define MacGetCurrentProcess GetCurrentProcess
  171. #endif
  172. EXTERN_API( OSErr )
  173. MacGetCurrentProcess            (ProcessSerialNumber *    PSN)                                THREEWORDINLINE(0x3F3C, 0x0037, 0xA88F);
  174.  
  175. EXTERN_API( OSErr )
  176. GetFrontProcess                    (ProcessSerialNumber *    PSN)                                FIVEWORDINLINE(0x70FF, 0x2F00, 0x3F3C, 0x0039, 0xA88F);
  177.  
  178. EXTERN_API( OSErr )
  179. GetNextProcess                    (ProcessSerialNumber *    PSN)                                THREEWORDINLINE(0x3F3C, 0x0038, 0xA88F);
  180.  
  181. EXTERN_API( OSErr )
  182. GetProcessInformation            (const ProcessSerialNumber * PSN,
  183.                                  ProcessInfoRec *        info)                                THREEWORDINLINE(0x3F3C, 0x003A, 0xA88F);
  184.  
  185. EXTERN_API( OSErr )
  186. SetFrontProcess                    (const ProcessSerialNumber * PSN)                            THREEWORDINLINE(0x3F3C, 0x003B, 0xA88F);
  187.  
  188. EXTERN_API( OSErr )
  189. WakeUpProcess                    (const ProcessSerialNumber * PSN)                            THREEWORDINLINE(0x3F3C, 0x003C, 0xA88F);
  190.  
  191. EXTERN_API( OSErr )
  192. SameProcess                        (const ProcessSerialNumber * PSN1,
  193.                                  const ProcessSerialNumber * PSN2,
  194.                                  Boolean *                result)                                THREEWORDINLINE(0x3F3C, 0x003D, 0xA88F);
  195.  
  196. #if !OLDROUTINELOCATIONS
  197. /*
  198.     ExitToShell was previously in SegLoad.h
  199. */
  200. EXTERN_API( void )
  201. ExitToShell                        (void)                                                        ONEWORDINLINE(0xA9F4);
  202.  
  203. #endif  /*  !OLDROUTINELOCATIONS */
  204.  
  205.  
  206.  
  207. #if PRAGMA_STRUCT_ALIGN
  208.     #pragma options align=reset
  209. #elif PRAGMA_STRUCT_PACKPUSH
  210.     #pragma pack(pop)
  211. #elif PRAGMA_STRUCT_PACK
  212.     #pragma pack()
  213. #endif
  214.  
  215. #ifdef PRAGMA_IMPORT_OFF
  216. #pragma import off
  217. #elif PRAGMA_IMPORT
  218. #pragma import reset
  219. #endif
  220.  
  221. #ifdef __cplusplus
  222. }
  223. #endif
  224.  
  225. #endif /* __PROCESSES__ */
  226.  
  227.